# 使用 Python 3.7.9 作为基础镜像
FROM python:3.7.9

# 将 requirements.txt 复制到容器中
COPY requirements.txt /app/requirements.txt
COPY jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
# 文件备份目录
# RUN mkdir /app/checkpoints


# pip换源
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

# 更新pip
RUN pip install --upgrade pip

# 安装所需的 Python 库
RUN pip install -r /app/requirements.txt

# 安装 JupyterLab
# RUN pip install jupyterlab

# 开放端口 80 用于 JupyterLab
EXPOSE 80

# 设置工作目录
WORKDIR /app


RUN chmod -R 777 /root/.jupyter

# 设置容器启动时要执行的命令
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=80", "--allow-root", "--no-browser"]
